#pragma once

#include <stdio.h>
#include <assert.h>
#include <stdbool.h>
#include <stdlib.h>

typedef int DequeDataType;

typedef struct DequeNode {
    DequeDataType data;
    int index;
    struct DequeNode* next;
    struct DequeNode* prev;
} DequeNode;

typedef struct {
    DequeNode* head;
    DequeNode* tail;
    int size;
} Deque;

Deque* createDeque();
void insertFront(Deque* deque, DequeDataType data, int index);
void insertRear(Deque* deque, DequeDataType data, int index);
DequeDataType deleteFront(Deque* deque);
DequeDataType deleteRear(Deque* deque);
int getDequeSize(Deque* deque);
int isDequeEmpty(Deque* deque);
void deleteALlElement(Deque* deque);
void destroyDeque(Deque* deque);
DequeDataType peekFront(Deque* deque);
DequeDataType peekRear(Deque* deque);
int FrontIndex(Deque* deque);
int* maxSlidingWindow(int* nums, int numsSize, int k, int* returnSize);